package com.mesa.android.avatalk.mvvm.login.ui.adapter

import androidx.databinding.ObservableArrayList
import com.mesa.android.avatalk.R
import com.mesa.android.avatalk.base.AvatalkBaseAdapter
import com.mesa.android.avatalk.base.ext.clickWithTrigger
import com.mesa.android.avatalk.base.utils.DisplayUtils
import com.mesa.android.avatalk.base.utils.ResourcesUtils
import com.mesa.android.avatalk.databinding.AdapterPopmenuLanguageItemBinding
import com.mesa.android.avatalk.mvvm.login.model.PopMenuItem

/**
 * Author: [author]
 * Date: [date]
 * Description:
 */
 
class [name]Adapter(list:ObservableArrayList<[model]>):AvatalkBaseAdapter<[model],Adapter[name]Binding>(list, null) {

    var onItemClick: ((type:Int,bean:[model])->Unit) ?= null

    override fun getLayoutResId() = R.layout.adapter_[name]

    override fun onBindItem(
        binding: Adapter[name]Binding?,
        bean: [model],
        position: Int,
        itemClickListener: OnItemClickListener<[model]>?
    ) {
        binding?.model = bean
        binding?.root?.clickWithTrigger {
            onItemClick?.invoke(0,bean)
        }
    }
}